﻿using System;
using System.Collections.Generic;
using System.Text;
using MbUnit.Framework;
using MyTestRunner.Infrastructure;

namespace MyTestRunner.Tests.Infrastructure
{
    /// <summary>
    /// Specifies how the HasAtleastOneElement on the EnumerableHelper should behave.
    /// </summary>
    [TestFixture]
    [TestsOn(typeof(EnumerableHelper))]
    public class WhenVerifyingThatEnumerableHasAtleastOneElement
    {
        /// <summary>
        /// Given that the enumerable does not contain elements, the result should be false.
        /// </summary>
        [Test]
        public void ShouldReturnFalseGivenNoElementAreInEnumerable()
        {
            Assert.IsFalse(EnumerableHelper.HasAtleastOneElement<int>(new int[] { }));
        }

        /// <summary>
        /// Given that the enumerable contains atleast one element, the result should be true.
        /// </summary>
        [Test]
        public void ShouldReturnTrueGivenAnElementIsInEnumerable()
        {
            Assert.IsTrue(EnumerableHelper.HasAtleastOneElement<int>(new int[] { 1 }));
        }
    }
}
